# imports
from keras.applications.inception_v3 import InceptionV3
from keras.models import Model, Input
from keras.layers import Dense, Conv2D, MaxPool2D, Dropout
from keras.layers import Flatten
from keras.applications.vgg16 import decode_predictions
from keras.models import Sequential
from keras.optimizers import Adam, Adamax
import glob
import matplotlib.pyplot as plt
from PIL import Image
import numpy as np
import tensorflow as tf
seed = 1
np.random.seed(seed)
tf.random.set_seed(seed)
# load data
X = []
Y = []
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/anger/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(1) # anger class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/disgust/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(2) # disgust class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/fear/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(3) # fear class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/happy/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(4) # happy class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/neutral/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(5) # neutral class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/sad/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(6) # sad class
for filename in glob.glob('/content/drive/MyDrive/images/pretrained/training/surprised/*.jpg'):
im=Image.open(filename).convert('RGB')
im=im.resize((224,224))
arr = np.array(im)
X.append(arr)
Y.append(7) # surprised class
# convert to np array
X = np.array(X)
# reshape
X = X.reshape(X.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
X = X /255
# encode outputs
Y = np.array(Y)
# randomize the data set - numpy arrays
randomize = np.arange(len(X))
np.random.shuffle(randomize)
X = X[randomize]
Y = Y[randomize]
Y = tf.keras.utils.to_categorical(Y)
num_classes = Y.shape[1]
inception = InceptionV3(include_top=False, weights='imagenet', input_shape=(224,224,3))
output = inception.layers[-1].output
output = tf.keras.layers.Flatten()(output)
inception = Model(inception.input, outputs=output)
for layer in inception.layers:
layer.trainable = False
inception.summary()
Downloading data from https://storage.googleapis.com/tensorflow/keras-applications/inception_v3/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5
87916544/87910968 [==============================] - 1s 0us/step
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 224, 224, 3) 0
__________________________________________________________________________________________________
conv2d (Conv2D) (None, 111, 111, 32) 864 input_1[0][0]
__________________________________________________________________________________________________
batch_normalization (BatchNorma (None, 111, 111, 32) 96 conv2d[0][0]
__________________________________________________________________________________________________
activation (Activation) (None, 111, 111, 32) 0 batch_normalization[0][0]
__________________________________________________________________________________________________
conv2d_1 (Conv2D) (None, 109, 109, 32) 9216 activation[0][0]
__________________________________________________________________________________________________
batch_normalization_1 (BatchNor (None, 109, 109, 32) 96 conv2d_1[0][0]
__________________________________________________________________________________________________
activation_1 (Activation) (None, 109, 109, 32) 0 batch_normalization_1[0][0]
__________________________________________________________________________________________________
conv2d_2 (Conv2D) (None, 109, 109, 64) 18432 activation_1[0][0]
__________________________________________________________________________________________________
batch_normalization_2 (BatchNor (None, 109, 109, 64) 192 conv2d_2[0][0]
__________________________________________________________________________________________________
activation_2 (Activation) (None, 109, 109, 64) 0 batch_normalization_2[0][0]
__________________________________________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 54, 54, 64) 0 activation_2[0][0]
__________________________________________________________________________________________________
conv2d_3 (Conv2D) (None, 54, 54, 80) 5120 max_pooling2d[0][0]
__________________________________________________________________________________________________
batch_normalization_3 (BatchNor (None, 54, 54, 80) 240 conv2d_3[0][0]
__________________________________________________________________________________________________
activation_3 (Activation) (None, 54, 54, 80) 0 batch_normalization_3[0][0]
__________________________________________________________________________________________________
conv2d_4 (Conv2D) (None, 52, 52, 192) 138240 activation_3[0][0]
__________________________________________________________________________________________________
batch_normalization_4 (BatchNor (None, 52, 52, 192) 576 conv2d_4[0][0]
__________________________________________________________________________________________________
activation_4 (Activation) (None, 52, 52, 192) 0 batch_normalization_4[0][0]
__________________________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D) (None, 25, 25, 192) 0 activation_4[0][0]
__________________________________________________________________________________________________
conv2d_8 (Conv2D) (None, 25, 25, 64) 12288 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
batch_normalization_8 (BatchNor (None, 25, 25, 64) 192 conv2d_8[0][0]
__________________________________________________________________________________________________
activation_8 (Activation) (None, 25, 25, 64) 0 batch_normalization_8[0][0]
__________________________________________________________________________________________________
conv2d_6 (Conv2D) (None, 25, 25, 48) 9216 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_9 (Conv2D) (None, 25, 25, 96) 55296 activation_8[0][0]
__________________________________________________________________________________________________
batch_normalization_6 (BatchNor (None, 25, 25, 48) 144 conv2d_6[0][0]
__________________________________________________________________________________________________
batch_normalization_9 (BatchNor (None, 25, 25, 96) 288 conv2d_9[0][0]
__________________________________________________________________________________________________
activation_6 (Activation) (None, 25, 25, 48) 0 batch_normalization_6[0][0]
__________________________________________________________________________________________________
activation_9 (Activation) (None, 25, 25, 96) 0 batch_normalization_9[0][0]
__________________________________________________________________________________________________
average_pooling2d (AveragePooli (None, 25, 25, 192) 0 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_5 (Conv2D) (None, 25, 25, 64) 12288 max_pooling2d_1[0][0]
__________________________________________________________________________________________________
conv2d_7 (Conv2D) (None, 25, 25, 64) 76800 activation_6[0][0]
__________________________________________________________________________________________________
conv2d_10 (Conv2D) (None, 25, 25, 96) 82944 activation_9[0][0]
__________________________________________________________________________________________________
conv2d_11 (Conv2D) (None, 25, 25, 32) 6144 average_pooling2d[0][0]
__________________________________________________________________________________________________
batch_normalization_5 (BatchNor (None, 25, 25, 64) 192 conv2d_5[0][0]
__________________________________________________________________________________________________
batch_normalization_7 (BatchNor (None, 25, 25, 64) 192 conv2d_7[0][0]
__________________________________________________________________________________________________
batch_normalization_10 (BatchNo (None, 25, 25, 96) 288 conv2d_10[0][0]
__________________________________________________________________________________________________
batch_normalization_11 (BatchNo (None, 25, 25, 32) 96 conv2d_11[0][0]
__________________________________________________________________________________________________
activation_5 (Activation) (None, 25, 25, 64) 0 batch_normalization_5[0][0]
__________________________________________________________________________________________________
activation_7 (Activation) (None, 25, 25, 64) 0 batch_normalization_7[0][0]
__________________________________________________________________________________________________
activation_10 (Activation) (None, 25, 25, 96) 0 batch_normalization_10[0][0]
__________________________________________________________________________________________________
activation_11 (Activation) (None, 25, 25, 32) 0 batch_normalization_11[0][0]
__________________________________________________________________________________________________
mixed0 (Concatenate) (None, 25, 25, 256) 0 activation_5[0][0]
activation_7[0][0]
activation_10[0][0]
activation_11[0][0]
__________________________________________________________________________________________________
conv2d_15 (Conv2D) (None, 25, 25, 64) 16384 mixed0[0][0]
__________________________________________________________________________________________________
batch_normalization_15 (BatchNo (None, 25, 25, 64) 192 conv2d_15[0][0]
__________________________________________________________________________________________________
activation_15 (Activation) (None, 25, 25, 64) 0 batch_normalization_15[0][0]
__________________________________________________________________________________________________
conv2d_13 (Conv2D) (None, 25, 25, 48) 12288 mixed0[0][0]
__________________________________________________________________________________________________
conv2d_16 (Conv2D) (None, 25, 25, 96) 55296 activation_15[0][0]
__________________________________________________________________________________________________
batch_normalization_13 (BatchNo (None, 25, 25, 48) 144 conv2d_13[0][0]
__________________________________________________________________________________________________
batch_normalization_16 (BatchNo (None, 25, 25, 96) 288 conv2d_16[0][0]
__________________________________________________________________________________________________
activation_13 (Activation) (None, 25, 25, 48) 0 batch_normalization_13[0][0]
__________________________________________________________________________________________________
activation_16 (Activation) (None, 25, 25, 96) 0 batch_normalization_16[0][0]
__________________________________________________________________________________________________
average_pooling2d_1 (AveragePoo (None, 25, 25, 256) 0 mixed0[0][0]
__________________________________________________________________________________________________
conv2d_12 (Conv2D) (None, 25, 25, 64) 16384 mixed0[0][0]
__________________________________________________________________________________________________
conv2d_14 (Conv2D) (None, 25, 25, 64) 76800 activation_13[0][0]
__________________________________________________________________________________________________
conv2d_17 (Conv2D) (None, 25, 25, 96) 82944 activation_16[0][0]
__________________________________________________________________________________________________
conv2d_18 (Conv2D) (None, 25, 25, 64) 16384 average_pooling2d_1[0][0]
__________________________________________________________________________________________________
batch_normalization_12 (BatchNo (None, 25, 25, 64) 192 conv2d_12[0][0]
__________________________________________________________________________________________________
batch_normalization_14 (BatchNo (None, 25, 25, 64) 192 conv2d_14[0][0]
__________________________________________________________________________________________________
batch_normalization_17 (BatchNo (None, 25, 25, 96) 288 conv2d_17[0][0]
__________________________________________________________________________________________________
batch_normalization_18 (BatchNo (None, 25, 25, 64) 192 conv2d_18[0][0]
__________________________________________________________________________________________________
activation_12 (Activation) (None, 25, 25, 64) 0 batch_normalization_12[0][0]
__________________________________________________________________________________________________
activation_14 (Activation) (None, 25, 25, 64) 0 batch_normalization_14[0][0]
__________________________________________________________________________________________________
activation_17 (Activation) (None, 25, 25, 96) 0 batch_normalization_17[0][0]
__________________________________________________________________________________________________
activation_18 (Activation) (None, 25, 25, 64) 0 batch_normalization_18[0][0]
__________________________________________________________________________________________________
mixed1 (Concatenate) (None, 25, 25, 288) 0 activation_12[0][0]
activation_14[0][0]
activation_17[0][0]
activation_18[0][0]
__________________________________________________________________________________________________
conv2d_22 (Conv2D) (None, 25, 25, 64) 18432 mixed1[0][0]
__________________________________________________________________________________________________
batch_normalization_22 (BatchNo (None, 25, 25, 64) 192 conv2d_22[0][0]
__________________________________________________________________________________________________
activation_22 (Activation) (None, 25, 25, 64) 0 batch_normalization_22[0][0]
__________________________________________________________________________________________________
conv2d_20 (Conv2D) (None, 25, 25, 48) 13824 mixed1[0][0]
__________________________________________________________________________________________________
conv2d_23 (Conv2D) (None, 25, 25, 96) 55296 activation_22[0][0]
__________________________________________________________________________________________________
batch_normalization_20 (BatchNo (None, 25, 25, 48) 144 conv2d_20[0][0]
__________________________________________________________________________________________________
batch_normalization_23 (BatchNo (None, 25, 25, 96) 288 conv2d_23[0][0]
__________________________________________________________________________________________________
activation_20 (Activation) (None, 25, 25, 48) 0 batch_normalization_20[0][0]
__________________________________________________________________________________________________
activation_23 (Activation) (None, 25, 25, 96) 0 batch_normalization_23[0][0]
__________________________________________________________________________________________________
average_pooling2d_2 (AveragePoo (None, 25, 25, 288) 0 mixed1[0][0]
__________________________________________________________________________________________________
conv2d_19 (Conv2D) (None, 25, 25, 64) 18432 mixed1[0][0]
__________________________________________________________________________________________________
conv2d_21 (Conv2D) (None, 25, 25, 64) 76800 activation_20[0][0]
__________________________________________________________________________________________________
conv2d_24 (Conv2D) (None, 25, 25, 96) 82944 activation_23[0][0]
__________________________________________________________________________________________________
conv2d_25 (Conv2D) (None, 25, 25, 64) 18432 average_pooling2d_2[0][0]
__________________________________________________________________________________________________
batch_normalization_19 (BatchNo (None, 25, 25, 64) 192 conv2d_19[0][0]
__________________________________________________________________________________________________
batch_normalization_21 (BatchNo (None, 25, 25, 64) 192 conv2d_21[0][0]
__________________________________________________________________________________________________
batch_normalization_24 (BatchNo (None, 25, 25, 96) 288 conv2d_24[0][0]
__________________________________________________________________________________________________
batch_normalization_25 (BatchNo (None, 25, 25, 64) 192 conv2d_25[0][0]
__________________________________________________________________________________________________
activation_19 (Activation) (None, 25, 25, 64) 0 batch_normalization_19[0][0]
__________________________________________________________________________________________________
activation_21 (Activation) (None, 25, 25, 64) 0 batch_normalization_21[0][0]
__________________________________________________________________________________________________
activation_24 (Activation) (None, 25, 25, 96) 0 batch_normalization_24[0][0]
__________________________________________________________________________________________________
activation_25 (Activation) (None, 25, 25, 64) 0 batch_normalization_25[0][0]
__________________________________________________________________________________________________
mixed2 (Concatenate) (None, 25, 25, 288) 0 activation_19[0][0]
activation_21[0][0]
activation_24[0][0]
activation_25[0][0]
__________________________________________________________________________________________________
conv2d_27 (Conv2D) (None, 25, 25, 64) 18432 mixed2[0][0]
__________________________________________________________________________________________________
batch_normalization_27 (BatchNo (None, 25, 25, 64) 192 conv2d_27[0][0]
__________________________________________________________________________________________________
activation_27 (Activation) (None, 25, 25, 64) 0 batch_normalization_27[0][0]
__________________________________________________________________________________________________
conv2d_28 (Conv2D) (None, 25, 25, 96) 55296 activation_27[0][0]
__________________________________________________________________________________________________
batch_normalization_28 (BatchNo (None, 25, 25, 96) 288 conv2d_28[0][0]
__________________________________________________________________________________________________
activation_28 (Activation) (None, 25, 25, 96) 0 batch_normalization_28[0][0]
__________________________________________________________________________________________________
conv2d_26 (Conv2D) (None, 12, 12, 384) 995328 mixed2[0][0]
__________________________________________________________________________________________________
conv2d_29 (Conv2D) (None, 12, 12, 96) 82944 activation_28[0][0]
__________________________________________________________________________________________________
batch_normalization_26 (BatchNo (None, 12, 12, 384) 1152 conv2d_26[0][0]
__________________________________________________________________________________________________
batch_normalization_29 (BatchNo (None, 12, 12, 96) 288 conv2d_29[0][0]
__________________________________________________________________________________________________
activation_26 (Activation) (None, 12, 12, 384) 0 batch_normalization_26[0][0]
__________________________________________________________________________________________________
activation_29 (Activation) (None, 12, 12, 96) 0 batch_normalization_29[0][0]
__________________________________________________________________________________________________
max_pooling2d_2 (MaxPooling2D) (None, 12, 12, 288) 0 mixed2[0][0]
__________________________________________________________________________________________________
mixed3 (Concatenate) (None, 12, 12, 768) 0 activation_26[0][0]
activation_29[0][0]
max_pooling2d_2[0][0]
__________________________________________________________________________________________________
conv2d_34 (Conv2D) (None, 12, 12, 128) 98304 mixed3[0][0]
__________________________________________________________________________________________________
batch_normalization_34 (BatchNo (None, 12, 12, 128) 384 conv2d_34[0][0]
__________________________________________________________________________________________________
activation_34 (Activation) (None, 12, 12, 128) 0 batch_normalization_34[0][0]
__________________________________________________________________________________________________
conv2d_35 (Conv2D) (None, 12, 12, 128) 114688 activation_34[0][0]
__________________________________________________________________________________________________
batch_normalization_35 (BatchNo (None, 12, 12, 128) 384 conv2d_35[0][0]
__________________________________________________________________________________________________
activation_35 (Activation) (None, 12, 12, 128) 0 batch_normalization_35[0][0]
__________________________________________________________________________________________________
conv2d_31 (Conv2D) (None, 12, 12, 128) 98304 mixed3[0][0]
__________________________________________________________________________________________________
conv2d_36 (Conv2D) (None, 12, 12, 128) 114688 activation_35[0][0]
__________________________________________________________________________________________________
batch_normalization_31 (BatchNo (None, 12, 12, 128) 384 conv2d_31[0][0]
__________________________________________________________________________________________________
batch_normalization_36 (BatchNo (None, 12, 12, 128) 384 conv2d_36[0][0]
__________________________________________________________________________________________________
activation_31 (Activation) (None, 12, 12, 128) 0 batch_normalization_31[0][0]
__________________________________________________________________________________________________
activation_36 (Activation) (None, 12, 12, 128) 0 batch_normalization_36[0][0]
__________________________________________________________________________________________________
conv2d_32 (Conv2D) (None, 12, 12, 128) 114688 activation_31[0][0]
__________________________________________________________________________________________________
conv2d_37 (Conv2D) (None, 12, 12, 128) 114688 activation_36[0][0]
__________________________________________________________________________________________________
batch_normalization_32 (BatchNo (None, 12, 12, 128) 384 conv2d_32[0][0]
__________________________________________________________________________________________________
batch_normalization_37 (BatchNo (None, 12, 12, 128) 384 conv2d_37[0][0]
__________________________________________________________________________________________________
activation_32 (Activation) (None, 12, 12, 128) 0 batch_normalization_32[0][0]
__________________________________________________________________________________________________
activation_37 (Activation) (None, 12, 12, 128) 0 batch_normalization_37[0][0]
__________________________________________________________________________________________________
average_pooling2d_3 (AveragePoo (None, 12, 12, 768) 0 mixed3[0][0]
__________________________________________________________________________________________________
conv2d_30 (Conv2D) (None, 12, 12, 192) 147456 mixed3[0][0]
__________________________________________________________________________________________________
conv2d_33 (Conv2D) (None, 12, 12, 192) 172032 activation_32[0][0]
__________________________________________________________________________________________________
conv2d_38 (Conv2D) (None, 12, 12, 192) 172032 activation_37[0][0]
__________________________________________________________________________________________________
conv2d_39 (Conv2D) (None, 12, 12, 192) 147456 average_pooling2d_3[0][0]
__________________________________________________________________________________________________
batch_normalization_30 (BatchNo (None, 12, 12, 192) 576 conv2d_30[0][0]
__________________________________________________________________________________________________
batch_normalization_33 (BatchNo (None, 12, 12, 192) 576 conv2d_33[0][0]
__________________________________________________________________________________________________
batch_normalization_38 (BatchNo (None, 12, 12, 192) 576 conv2d_38[0][0]
__________________________________________________________________________________________________
batch_normalization_39 (BatchNo (None, 12, 12, 192) 576 conv2d_39[0][0]
__________________________________________________________________________________________________
activation_30 (Activation) (None, 12, 12, 192) 0 batch_normalization_30[0][0]
__________________________________________________________________________________________________
activation_33 (Activation) (None, 12, 12, 192) 0 batch_normalization_33[0][0]
__________________________________________________________________________________________________
activation_38 (Activation) (None, 12, 12, 192) 0 batch_normalization_38[0][0]
__________________________________________________________________________________________________
activation_39 (Activation) (None, 12, 12, 192) 0 batch_normalization_39[0][0]
__________________________________________________________________________________________________
mixed4 (Concatenate) (None, 12, 12, 768) 0 activation_30[0][0]
activation_33[0][0]
activation_38[0][0]
activation_39[0][0]
__________________________________________________________________________________________________
conv2d_44 (Conv2D) (None, 12, 12, 160) 122880 mixed4[0][0]
__________________________________________________________________________________________________
batch_normalization_44 (BatchNo (None, 12, 12, 160) 480 conv2d_44[0][0]
__________________________________________________________________________________________________
activation_44 (Activation) (None, 12, 12, 160) 0 batch_normalization_44[0][0]
__________________________________________________________________________________________________
conv2d_45 (Conv2D) (None, 12, 12, 160) 179200 activation_44[0][0]
__________________________________________________________________________________________________
batch_normalization_45 (BatchNo (None, 12, 12, 160) 480 conv2d_45[0][0]
__________________________________________________________________________________________________
activation_45 (Activation) (None, 12, 12, 160) 0 batch_normalization_45[0][0]
__________________________________________________________________________________________________
conv2d_41 (Conv2D) (None, 12, 12, 160) 122880 mixed4[0][0]
__________________________________________________________________________________________________
conv2d_46 (Conv2D) (None, 12, 12, 160) 179200 activation_45[0][0]
__________________________________________________________________________________________________
batch_normalization_41 (BatchNo (None, 12, 12, 160) 480 conv2d_41[0][0]
__________________________________________________________________________________________________
batch_normalization_46 (BatchNo (None, 12, 12, 160) 480 conv2d_46[0][0]
__________________________________________________________________________________________________
activation_41 (Activation) (None, 12, 12, 160) 0 batch_normalization_41[0][0]
__________________________________________________________________________________________________
activation_46 (Activation) (None, 12, 12, 160) 0 batch_normalization_46[0][0]
__________________________________________________________________________________________________
conv2d_42 (Conv2D) (None, 12, 12, 160) 179200 activation_41[0][0]
__________________________________________________________________________________________________
conv2d_47 (Conv2D) (None, 12, 12, 160) 179200 activation_46[0][0]
__________________________________________________________________________________________________
batch_normalization_42 (BatchNo (None, 12, 12, 160) 480 conv2d_42[0][0]
__________________________________________________________________________________________________
batch_normalization_47 (BatchNo (None, 12, 12, 160) 480 conv2d_47[0][0]
__________________________________________________________________________________________________
activation_42 (Activation) (None, 12, 12, 160) 0 batch_normalization_42[0][0]
__________________________________________________________________________________________________
activation_47 (Activation) (None, 12, 12, 160) 0 batch_normalization_47[0][0]
__________________________________________________________________________________________________
average_pooling2d_4 (AveragePoo (None, 12, 12, 768) 0 mixed4[0][0]
__________________________________________________________________________________________________
conv2d_40 (Conv2D) (None, 12, 12, 192) 147456 mixed4[0][0]
__________________________________________________________________________________________________
conv2d_43 (Conv2D) (None, 12, 12, 192) 215040 activation_42[0][0]
__________________________________________________________________________________________________
conv2d_48 (Conv2D) (None, 12, 12, 192) 215040 activation_47[0][0]
__________________________________________________________________________________________________
conv2d_49 (Conv2D) (None, 12, 12, 192) 147456 average_pooling2d_4[0][0]
__________________________________________________________________________________________________
batch_normalization_40 (BatchNo (None, 12, 12, 192) 576 conv2d_40[0][0]
__________________________________________________________________________________________________
batch_normalization_43 (BatchNo (None, 12, 12, 192) 576 conv2d_43[0][0]
__________________________________________________________________________________________________
batch_normalization_48 (BatchNo (None, 12, 12, 192) 576 conv2d_48[0][0]
__________________________________________________________________________________________________
batch_normalization_49 (BatchNo (None, 12, 12, 192) 576 conv2d_49[0][0]
__________________________________________________________________________________________________
activation_40 (Activation) (None, 12, 12, 192) 0 batch_normalization_40[0][0]
__________________________________________________________________________________________________
activation_43 (Activation) (None, 12, 12, 192) 0 batch_normalization_43[0][0]
__________________________________________________________________________________________________
activation_48 (Activation) (None, 12, 12, 192) 0 batch_normalization_48[0][0]
__________________________________________________________________________________________________
activation_49 (Activation) (None, 12, 12, 192) 0 batch_normalization_49[0][0]
__________________________________________________________________________________________________
mixed5 (Concatenate) (None, 12, 12, 768) 0 activation_40[0][0]
activation_43[0][0]
activation_48[0][0]
activation_49[0][0]
__________________________________________________________________________________________________
conv2d_54 (Conv2D) (None, 12, 12, 160) 122880 mixed5[0][0]
__________________________________________________________________________________________________
batch_normalization_54 (BatchNo (None, 12, 12, 160) 480 conv2d_54[0][0]
__________________________________________________________________________________________________
activation_54 (Activation) (None, 12, 12, 160) 0 batch_normalization_54[0][0]
__________________________________________________________________________________________________
conv2d_55 (Conv2D) (None, 12, 12, 160) 179200 activation_54[0][0]
__________________________________________________________________________________________________
batch_normalization_55 (BatchNo (None, 12, 12, 160) 480 conv2d_55[0][0]
__________________________________________________________________________________________________
activation_55 (Activation) (None, 12, 12, 160) 0 batch_normalization_55[0][0]
__________________________________________________________________________________________________
conv2d_51 (Conv2D) (None, 12, 12, 160) 122880 mixed5[0][0]
__________________________________________________________________________________________________
conv2d_56 (Conv2D) (None, 12, 12, 160) 179200 activation_55[0][0]
__________________________________________________________________________________________________
batch_normalization_51 (BatchNo (None, 12, 12, 160) 480 conv2d_51[0][0]
__________________________________________________________________________________________________
batch_normalization_56 (BatchNo (None, 12, 12, 160) 480 conv2d_56[0][0]
__________________________________________________________________________________________________
activation_51 (Activation) (None, 12, 12, 160) 0 batch_normalization_51[0][0]
__________________________________________________________________________________________________
activation_56 (Activation) (None, 12, 12, 160) 0 batch_normalization_56[0][0]
__________________________________________________________________________________________________
conv2d_52 (Conv2D) (None, 12, 12, 160) 179200 activation_51[0][0]
__________________________________________________________________________________________________
conv2d_57 (Conv2D) (None, 12, 12, 160) 179200 activation_56[0][0]
__________________________________________________________________________________________________
batch_normalization_52 (BatchNo (None, 12, 12, 160) 480 conv2d_52[0][0]
__________________________________________________________________________________________________
batch_normalization_57 (BatchNo (None, 12, 12, 160) 480 conv2d_57[0][0]
__________________________________________________________________________________________________
activation_52 (Activation) (None, 12, 12, 160) 0 batch_normalization_52[0][0]
__________________________________________________________________________________________________
activation_57 (Activation) (None, 12, 12, 160) 0 batch_normalization_57[0][0]
__________________________________________________________________________________________________
average_pooling2d_5 (AveragePoo (None, 12, 12, 768) 0 mixed5[0][0]
__________________________________________________________________________________________________
conv2d_50 (Conv2D) (None, 12, 12, 192) 147456 mixed5[0][0]
__________________________________________________________________________________________________
conv2d_53 (Conv2D) (None, 12, 12, 192) 215040 activation_52[0][0]
__________________________________________________________________________________________________
conv2d_58 (Conv2D) (None, 12, 12, 192) 215040 activation_57[0][0]
__________________________________________________________________________________________________
conv2d_59 (Conv2D) (None, 12, 12, 192) 147456 average_pooling2d_5[0][0]
__________________________________________________________________________________________________
batch_normalization_50 (BatchNo (None, 12, 12, 192) 576 conv2d_50[0][0]
__________________________________________________________________________________________________
batch_normalization_53 (BatchNo (None, 12, 12, 192) 576 conv2d_53[0][0]
__________________________________________________________________________________________________
batch_normalization_58 (BatchNo (None, 12, 12, 192) 576 conv2d_58[0][0]
__________________________________________________________________________________________________
batch_normalization_59 (BatchNo (None, 12, 12, 192) 576 conv2d_59[0][0]
__________________________________________________________________________________________________
activation_50 (Activation) (None, 12, 12, 192) 0 batch_normalization_50[0][0]
__________________________________________________________________________________________________
activation_53 (Activation) (None, 12, 12, 192) 0 batch_normalization_53[0][0]
__________________________________________________________________________________________________
activation_58 (Activation) (None, 12, 12, 192) 0 batch_normalization_58[0][0]
__________________________________________________________________________________________________
activation_59 (Activation) (None, 12, 12, 192) 0 batch_normalization_59[0][0]
__________________________________________________________________________________________________
mixed6 (Concatenate) (None, 12, 12, 768) 0 activation_50[0][0]
activation_53[0][0]
activation_58[0][0]
activation_59[0][0]
__________________________________________________________________________________________________
conv2d_64 (Conv2D) (None, 12, 12, 192) 147456 mixed6[0][0]
__________________________________________________________________________________________________
batch_normalization_64 (BatchNo (None, 12, 12, 192) 576 conv2d_64[0][0]
__________________________________________________________________________________________________
activation_64 (Activation) (None, 12, 12, 192) 0 batch_normalization_64[0][0]
__________________________________________________________________________________________________
conv2d_65 (Conv2D) (None, 12, 12, 192) 258048 activation_64[0][0]
__________________________________________________________________________________________________
batch_normalization_65 (BatchNo (None, 12, 12, 192) 576 conv2d_65[0][0]
__________________________________________________________________________________________________
activation_65 (Activation) (None, 12, 12, 192) 0 batch_normalization_65[0][0]
__________________________________________________________________________________________________
conv2d_61 (Conv2D) (None, 12, 12, 192) 147456 mixed6[0][0]
__________________________________________________________________________________________________
conv2d_66 (Conv2D) (None, 12, 12, 192) 258048 activation_65[0][0]
__________________________________________________________________________________________________
batch_normalization_61 (BatchNo (None, 12, 12, 192) 576 conv2d_61[0][0]
__________________________________________________________________________________________________
batch_normalization_66 (BatchNo (None, 12, 12, 192) 576 conv2d_66[0][0]
__________________________________________________________________________________________________
activation_61 (Activation) (None, 12, 12, 192) 0 batch_normalization_61[0][0]
__________________________________________________________________________________________________
activation_66 (Activation) (None, 12, 12, 192) 0 batch_normalization_66[0][0]
__________________________________________________________________________________________________
conv2d_62 (Conv2D) (None, 12, 12, 192) 258048 activation_61[0][0]
__________________________________________________________________________________________________
conv2d_67 (Conv2D) (None, 12, 12, 192) 258048 activation_66[0][0]
__________________________________________________________________________________________________
batch_normalization_62 (BatchNo (None, 12, 12, 192) 576 conv2d_62[0][0]
__________________________________________________________________________________________________
batch_normalization_67 (BatchNo (None, 12, 12, 192) 576 conv2d_67[0][0]
__________________________________________________________________________________________________
activation_62 (Activation) (None, 12, 12, 192) 0 batch_normalization_62[0][0]
__________________________________________________________________________________________________
activation_67 (Activation) (None, 12, 12, 192) 0 batch_normalization_67[0][0]
__________________________________________________________________________________________________
average_pooling2d_6 (AveragePoo (None, 12, 12, 768) 0 mixed6[0][0]
__________________________________________________________________________________________________
conv2d_60 (Conv2D) (None, 12, 12, 192) 147456 mixed6[0][0]
__________________________________________________________________________________________________
conv2d_63 (Conv2D) (None, 12, 12, 192) 258048 activation_62[0][0]
__________________________________________________________________________________________________
conv2d_68 (Conv2D) (None, 12, 12, 192) 258048 activation_67[0][0]
__________________________________________________________________________________________________
conv2d_69 (Conv2D) (None, 12, 12, 192) 147456 average_pooling2d_6[0][0]
__________________________________________________________________________________________________
batch_normalization_60 (BatchNo (None, 12, 12, 192) 576 conv2d_60[0][0]
__________________________________________________________________________________________________
batch_normalization_63 (BatchNo (None, 12, 12, 192) 576 conv2d_63[0][0]
__________________________________________________________________________________________________
batch_normalization_68 (BatchNo (None, 12, 12, 192) 576 conv2d_68[0][0]
__________________________________________________________________________________________________
batch_normalization_69 (BatchNo (None, 12, 12, 192) 576 conv2d_69[0][0]
__________________________________________________________________________________________________
activation_60 (Activation) (None, 12, 12, 192) 0 batch_normalization_60[0][0]
__________________________________________________________________________________________________
activation_63 (Activation) (None, 12, 12, 192) 0 batch_normalization_63[0][0]
__________________________________________________________________________________________________
activation_68 (Activation) (None, 12, 12, 192) 0 batch_normalization_68[0][0]
__________________________________________________________________________________________________
activation_69 (Activation) (None, 12, 12, 192) 0 batch_normalization_69[0][0]
__________________________________________________________________________________________________
mixed7 (Concatenate) (None, 12, 12, 768) 0 activation_60[0][0]
activation_63[0][0]
activation_68[0][0]
activation_69[0][0]
__________________________________________________________________________________________________
conv2d_72 (Conv2D) (None, 12, 12, 192) 147456 mixed7[0][0]
__________________________________________________________________________________________________
batch_normalization_72 (BatchNo (None, 12, 12, 192) 576 conv2d_72[0][0]
__________________________________________________________________________________________________
activation_72 (Activation) (None, 12, 12, 192) 0 batch_normalization_72[0][0]
__________________________________________________________________________________________________
conv2d_73 (Conv2D) (None, 12, 12, 192) 258048 activation_72[0][0]
__________________________________________________________________________________________________
batch_normalization_73 (BatchNo (None, 12, 12, 192) 576 conv2d_73[0][0]
__________________________________________________________________________________________________
activation_73 (Activation) (None, 12, 12, 192) 0 batch_normalization_73[0][0]
__________________________________________________________________________________________________
conv2d_70 (Conv2D) (None, 12, 12, 192) 147456 mixed7[0][0]
__________________________________________________________________________________________________
conv2d_74 (Conv2D) (None, 12, 12, 192) 258048 activation_73[0][0]
__________________________________________________________________________________________________
batch_normalization_70 (BatchNo (None, 12, 12, 192) 576 conv2d_70[0][0]
__________________________________________________________________________________________________
batch_normalization_74 (BatchNo (None, 12, 12, 192) 576 conv2d_74[0][0]
__________________________________________________________________________________________________
activation_70 (Activation) (None, 12, 12, 192) 0 batch_normalization_70[0][0]
__________________________________________________________________________________________________
activation_74 (Activation) (None, 12, 12, 192) 0 batch_normalization_74[0][0]
__________________________________________________________________________________________________
conv2d_71 (Conv2D) (None, 5, 5, 320) 552960 activation_70[0][0]
__________________________________________________________________________________________________
conv2d_75 (Conv2D) (None, 5, 5, 192) 331776 activation_74[0][0]
__________________________________________________________________________________________________
batch_normalization_71 (BatchNo (None, 5, 5, 320) 960 conv2d_71[0][0]
__________________________________________________________________________________________________
batch_normalization_75 (BatchNo (None, 5, 5, 192) 576 conv2d_75[0][0]
__________________________________________________________________________________________________
activation_71 (Activation) (None, 5, 5, 320) 0 batch_normalization_71[0][0]
__________________________________________________________________________________________________
activation_75 (Activation) (None, 5, 5, 192) 0 batch_normalization_75[0][0]
__________________________________________________________________________________________________
max_pooling2d_3 (MaxPooling2D) (None, 5, 5, 768) 0 mixed7[0][0]
__________________________________________________________________________________________________
mixed8 (Concatenate) (None, 5, 5, 1280) 0 activation_71[0][0]
activation_75[0][0]
max_pooling2d_3[0][0]
__________________________________________________________________________________________________
conv2d_80 (Conv2D) (None, 5, 5, 448) 573440 mixed8[0][0]
__________________________________________________________________________________________________
batch_normalization_80 (BatchNo (None, 5, 5, 448) 1344 conv2d_80[0][0]
__________________________________________________________________________________________________
activation_80 (Activation) (None, 5, 5, 448) 0 batch_normalization_80[0][0]
__________________________________________________________________________________________________
conv2d_77 (Conv2D) (None, 5, 5, 384) 491520 mixed8[0][0]
__________________________________________________________________________________________________
conv2d_81 (Conv2D) (None, 5, 5, 384) 1548288 activation_80[0][0]
__________________________________________________________________________________________________
batch_normalization_77 (BatchNo (None, 5, 5, 384) 1152 conv2d_77[0][0]
__________________________________________________________________________________________________
batch_normalization_81 (BatchNo (None, 5, 5, 384) 1152 conv2d_81[0][0]
__________________________________________________________________________________________________
activation_77 (Activation) (None, 5, 5, 384) 0 batch_normalization_77[0][0]
__________________________________________________________________________________________________
activation_81 (Activation) (None, 5, 5, 384) 0 batch_normalization_81[0][0]
__________________________________________________________________________________________________
conv2d_78 (Conv2D) (None, 5, 5, 384) 442368 activation_77[0][0]
__________________________________________________________________________________________________
conv2d_79 (Conv2D) (None, 5, 5, 384) 442368 activation_77[0][0]
__________________________________________________________________________________________________
conv2d_82 (Conv2D) (None, 5, 5, 384) 442368 activation_81[0][0]
__________________________________________________________________________________________________
conv2d_83 (Conv2D) (None, 5, 5, 384) 442368 activation_81[0][0]
__________________________________________________________________________________________________
average_pooling2d_7 (AveragePoo (None, 5, 5, 1280) 0 mixed8[0][0]
__________________________________________________________________________________________________
conv2d_76 (Conv2D) (None, 5, 5, 320) 409600 mixed8[0][0]
__________________________________________________________________________________________________
batch_normalization_78 (BatchNo (None, 5, 5, 384) 1152 conv2d_78[0][0]
__________________________________________________________________________________________________
batch_normalization_79 (BatchNo (None, 5, 5, 384) 1152 conv2d_79[0][0]
__________________________________________________________________________________________________
batch_normalization_82 (BatchNo (None, 5, 5, 384) 1152 conv2d_82[0][0]
__________________________________________________________________________________________________
batch_normalization_83 (BatchNo (None, 5, 5, 384) 1152 conv2d_83[0][0]
__________________________________________________________________________________________________
conv2d_84 (Conv2D) (None, 5, 5, 192) 245760 average_pooling2d_7[0][0]
__________________________________________________________________________________________________
batch_normalization_76 (BatchNo (None, 5, 5, 320) 960 conv2d_76[0][0]
__________________________________________________________________________________________________
activation_78 (Activation) (None, 5, 5, 384) 0 batch_normalization_78[0][0]
__________________________________________________________________________________________________
activation_79 (Activation) (None, 5, 5, 384) 0 batch_normalization_79[0][0]
__________________________________________________________________________________________________
activation_82 (Activation) (None, 5, 5, 384) 0 batch_normalization_82[0][0]
__________________________________________________________________________________________________
activation_83 (Activation) (None, 5, 5, 384) 0 batch_normalization_83[0][0]
__________________________________________________________________________________________________
batch_normalization_84 (BatchNo (None, 5, 5, 192) 576 conv2d_84[0][0]
__________________________________________________________________________________________________
activation_76 (Activation) (None, 5, 5, 320) 0 batch_normalization_76[0][0]
__________________________________________________________________________________________________
mixed9_0 (Concatenate) (None, 5, 5, 768) 0 activation_78[0][0]
activation_79[0][0]
__________________________________________________________________________________________________
concatenate (Concatenate) (None, 5, 5, 768) 0 activation_82[0][0]
activation_83[0][0]
__________________________________________________________________________________________________
activation_84 (Activation) (None, 5, 5, 192) 0 batch_normalization_84[0][0]
__________________________________________________________________________________________________
mixed9 (Concatenate) (None, 5, 5, 2048) 0 activation_76[0][0]
mixed9_0[0][0]
concatenate[0][0]
activation_84[0][0]
__________________________________________________________________________________________________
conv2d_89 (Conv2D) (None, 5, 5, 448) 917504 mixed9[0][0]
__________________________________________________________________________________________________
batch_normalization_89 (BatchNo (None, 5, 5, 448) 1344 conv2d_89[0][0]
__________________________________________________________________________________________________
activation_89 (Activation) (None, 5, 5, 448) 0 batch_normalization_89[0][0]
__________________________________________________________________________________________________
conv2d_86 (Conv2D) (None, 5, 5, 384) 786432 mixed9[0][0]
__________________________________________________________________________________________________
conv2d_90 (Conv2D) (None, 5, 5, 384) 1548288 activation_89[0][0]
__________________________________________________________________________________________________
batch_normalization_86 (BatchNo (None, 5, 5, 384) 1152 conv2d_86[0][0]
__________________________________________________________________________________________________
batch_normalization_90 (BatchNo (None, 5, 5, 384) 1152 conv2d_90[0][0]
__________________________________________________________________________________________________
activation_86 (Activation) (None, 5, 5, 384) 0 batch_normalization_86[0][0]
__________________________________________________________________________________________________
activation_90 (Activation) (None, 5, 5, 384) 0 batch_normalization_90[0][0]
__________________________________________________________________________________________________
conv2d_87 (Conv2D) (None, 5, 5, 384) 442368 activation_86[0][0]
__________________________________________________________________________________________________
conv2d_88 (Conv2D) (None, 5, 5, 384) 442368 activation_86[0][0]
__________________________________________________________________________________________________
conv2d_91 (Conv2D) (None, 5, 5, 384) 442368 activation_90[0][0]
__________________________________________________________________________________________________
conv2d_92 (Conv2D) (None, 5, 5, 384) 442368 activation_90[0][0]
__________________________________________________________________________________________________
average_pooling2d_8 (AveragePoo (None, 5, 5, 2048) 0 mixed9[0][0]
__________________________________________________________________________________________________
conv2d_85 (Conv2D) (None, 5, 5, 320) 655360 mixed9[0][0]
__________________________________________________________________________________________________
batch_normalization_87 (BatchNo (None, 5, 5, 384) 1152 conv2d_87[0][0]
__________________________________________________________________________________________________
batch_normalization_88 (BatchNo (None, 5, 5, 384) 1152 conv2d_88[0][0]
__________________________________________________________________________________________________
batch_normalization_91 (BatchNo (None, 5, 5, 384) 1152 conv2d_91[0][0]
__________________________________________________________________________________________________
batch_normalization_92 (BatchNo (None, 5, 5, 384) 1152 conv2d_92[0][0]
__________________________________________________________________________________________________
conv2d_93 (Conv2D) (None, 5, 5, 192) 393216 average_pooling2d_8[0][0]
__________________________________________________________________________________________________
batch_normalization_85 (BatchNo (None, 5, 5, 320) 960 conv2d_85[0][0]
__________________________________________________________________________________________________
activation_87 (Activation) (None, 5, 5, 384) 0 batch_normalization_87[0][0]
__________________________________________________________________________________________________
activation_88 (Activation) (None, 5, 5, 384) 0 batch_normalization_88[0][0]
__________________________________________________________________________________________________
activation_91 (Activation) (None, 5, 5, 384) 0 batch_normalization_91[0][0]
__________________________________________________________________________________________________
activation_92 (Activation) (None, 5, 5, 384) 0 batch_normalization_92[0][0]
__________________________________________________________________________________________________
batch_normalization_93 (BatchNo (None, 5, 5, 192) 576 conv2d_93[0][0]
__________________________________________________________________________________________________
activation_85 (Activation) (None, 5, 5, 320) 0 batch_normalization_85[0][0]
__________________________________________________________________________________________________
mixed9_1 (Concatenate) (None, 5, 5, 768) 0 activation_87[0][0]
activation_88[0][0]
__________________________________________________________________________________________________
concatenate_1 (Concatenate) (None, 5, 5, 768) 0 activation_91[0][0]
activation_92[0][0]
__________________________________________________________________________________________________
activation_93 (Activation) (None, 5, 5, 192) 0 batch_normalization_93[0][0]
__________________________________________________________________________________________________
mixed10 (Concatenate) (None, 5, 5, 2048) 0 activation_85[0][0]
mixed9_1[0][0]
concatenate_1[0][0]
activation_93[0][0]
__________________________________________________________________________________________________
flatten (Flatten) (None, 51200) 0 mixed10[0][0]
==================================================================================================
Total params: 21,802,784
Trainable params: 0
Non-trainable params: 21,802,784
__________________________________________________________________________________________________
# creation of the model, using the resnet architecture and adding my own classes after the flattening layer
model = Sequential()
model.add(inception)
model.add(Dense(512, activation='relu', input_dim= (224, 224, 3)))
model.add(Dropout(0.3))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.3))
model.add(Dense(num_classes, activation='softmax'))
# summary of the model
model.summary()
# specifying a learning rate to optimizer adam
opt = tf.keras.optimizers.Adam(lr=0.000001)
# compiling the model
model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['acc'])
# Fit the model
history = model.fit(X, Y, validation_split=0.40, epochs=25, batch_size=32, verbose=1)
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
Model: "sequential_1" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= model (Functional) (None, 51200) 21802784 _________________________________________________________________ dense_3 (Dense) (None, 512) 26214912 _________________________________________________________________ dropout_2 (Dropout) (None, 512) 0 _________________________________________________________________ dense_4 (Dense) (None, 512) 262656 _________________________________________________________________ dropout_3 (Dropout) (None, 512) 0 _________________________________________________________________ dense_5 (Dense) (None, 8) 4104 ================================================================= Total params: 48,284,456 Trainable params: 26,481,672 Non-trainable params: 21,802,784 _________________________________________________________________ Epoch 1/25 112/112 [==============================] - 19s 139ms/step - loss: 2.4377 - acc: 0.1632 - val_loss: 1.6282 - val_acc: 0.4095 Epoch 2/25 112/112 [==============================] - 14s 130ms/step - loss: 1.7687 - acc: 0.3488 - val_loss: 1.4142 - val_acc: 0.5084 Epoch 3/25 112/112 [==============================] - 14s 129ms/step - loss: 1.5609 - acc: 0.4380 - val_loss: 1.2743 - val_acc: 0.5729 Epoch 4/25 112/112 [==============================] - 14s 129ms/step - loss: 1.3799 - acc: 0.5151 - val_loss: 1.1622 - val_acc: 0.6211 Epoch 5/25 112/112 [==============================] - 14s 128ms/step - loss: 1.2712 - acc: 0.5535 - val_loss: 1.0726 - val_acc: 0.6702 Epoch 6/25 112/112 [==============================] - 14s 128ms/step - loss: 1.1739 - acc: 0.5988 - val_loss: 0.9996 - val_acc: 0.6928 Epoch 7/25 112/112 [==============================] - 14s 129ms/step - loss: 1.0878 - acc: 0.6307 - val_loss: 0.9364 - val_acc: 0.7213 Epoch 8/25 112/112 [==============================] - 14s 129ms/step - loss: 1.0334 - acc: 0.6540 - val_loss: 0.8794 - val_acc: 0.7347 Epoch 9/25 112/112 [==============================] - 14s 128ms/step - loss: 0.9588 - acc: 0.6736 - val_loss: 0.8321 - val_acc: 0.7506 Epoch 10/25 112/112 [==============================] - 14s 128ms/step - loss: 0.9008 - acc: 0.6932 - val_loss: 0.7860 - val_acc: 0.7699 Epoch 11/25 112/112 [==============================] - 14s 129ms/step - loss: 0.8814 - acc: 0.7131 - val_loss: 0.7484 - val_acc: 0.7812 Epoch 12/25 112/112 [==============================] - 14s 129ms/step - loss: 0.8116 - acc: 0.7458 - val_loss: 0.7126 - val_acc: 0.7883 Epoch 13/25 112/112 [==============================] - 14s 129ms/step - loss: 0.7909 - acc: 0.7378 - val_loss: 0.6817 - val_acc: 0.8001 Epoch 14/25 112/112 [==============================] - 14s 129ms/step - loss: 0.7193 - acc: 0.7835 - val_loss: 0.6554 - val_acc: 0.8005 Epoch 15/25 112/112 [==============================] - 14s 129ms/step - loss: 0.6916 - acc: 0.7824 - val_loss: 0.6245 - val_acc: 0.8265 Epoch 16/25 112/112 [==============================] - 14s 129ms/step - loss: 0.6366 - acc: 0.8079 - val_loss: 0.6012 - val_acc: 0.8386 Epoch 17/25 112/112 [==============================] - 14s 129ms/step - loss: 0.6179 - acc: 0.8109 - val_loss: 0.5775 - val_acc: 0.8428 Epoch 18/25 112/112 [==============================] - 14s 129ms/step - loss: 0.5992 - acc: 0.8234 - val_loss: 0.5551 - val_acc: 0.8504 Epoch 19/25 112/112 [==============================] - 14s 128ms/step - loss: 0.5760 - acc: 0.8263 - val_loss: 0.5405 - val_acc: 0.8529 Epoch 20/25 112/112 [==============================] - 14s 129ms/step - loss: 0.5556 - acc: 0.8371 - val_loss: 0.5199 - val_acc: 0.8642 Epoch 21/25 112/112 [==============================] - 14s 129ms/step - loss: 0.5044 - acc: 0.8625 - val_loss: 0.5050 - val_acc: 0.8667 Epoch 22/25 112/112 [==============================] - 14s 129ms/step - loss: 0.4995 - acc: 0.8562 - val_loss: 0.4915 - val_acc: 0.8692 Epoch 23/25 112/112 [==============================] - 14s 129ms/step - loss: 0.4814 - acc: 0.8616 - val_loss: 0.4774 - val_acc: 0.8726 Epoch 24/25 112/112 [==============================] - 14s 129ms/step - loss: 0.4454 - acc: 0.8703 - val_loss: 0.4642 - val_acc: 0.8743 Epoch 25/25 112/112 [==============================] - 14s 128ms/step - loss: 0.4313 - acc: 0.8771 - val_loss: 0.4517 - val_acc: 0.8814
# creation of the model, using the resnet architecture and adding my own classes after the flattening layer
model2 = Sequential()
model2.add(inception)
model2.add(Dense(512, activation='relu', input_dim= (224, 224, 3)))
model2.add(Dropout(0.3))
model2.add(Dense(512, activation='relu'))
model2.add(Dropout(0.3))
model2.add(Dense(num_classes, activation='softmax'))
# summary of the model
model2.summary()
# specifying a learning rate to optimizer adam
opt = tf.keras.optimizers.Adam(lr=0.000001)
# compiling the model
model2.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['acc'])
# Fit the model
history = model2.fit(X, Y, validation_split=0.40, epochs=40, batch_size=32, verbose=1)
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper right')
plt.show()
Model: "sequential_2" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= model (Functional) (None, 51200) 21802784 _________________________________________________________________ dense_6 (Dense) (None, 512) 26214912 _________________________________________________________________ dropout_4 (Dropout) (None, 512) 0 _________________________________________________________________ dense_7 (Dense) (None, 512) 262656 _________________________________________________________________ dropout_5 (Dropout) (None, 512) 0 _________________________________________________________________ dense_8 (Dense) (None, 8) 4104 ================================================================= Total params: 48,284,456 Trainable params: 26,481,672 Non-trainable params: 21,802,784 _________________________________________________________________ Epoch 1/40 112/112 [==============================] - 19s 138ms/step - loss: 2.4072 - acc: 0.1749 - val_loss: 1.6048 - val_acc: 0.4061 Epoch 2/40 112/112 [==============================] - 14s 128ms/step - loss: 1.8028 - acc: 0.3516 - val_loss: 1.4004 - val_acc: 0.5117 Epoch 3/40 112/112 [==============================] - 14s 129ms/step - loss: 1.5720 - acc: 0.4425 - val_loss: 1.2630 - val_acc: 0.5696 Epoch 4/40 112/112 [==============================] - 14s 130ms/step - loss: 1.4047 - acc: 0.4918 - val_loss: 1.1605 - val_acc: 0.6140 Epoch 5/40 112/112 [==============================] - 14s 129ms/step - loss: 1.2826 - acc: 0.5696 - val_loss: 1.0759 - val_acc: 0.6517 Epoch 6/40 112/112 [==============================] - 14s 128ms/step - loss: 1.1683 - acc: 0.6028 - val_loss: 1.0012 - val_acc: 0.6869 Epoch 7/40 112/112 [==============================] - 14s 128ms/step - loss: 1.1049 - acc: 0.6229 - val_loss: 0.9343 - val_acc: 0.7200 Epoch 8/40 112/112 [==============================] - 14s 128ms/step - loss: 1.0496 - acc: 0.6396 - val_loss: 0.8780 - val_acc: 0.7360 Epoch 9/40 112/112 [==============================] - 14s 129ms/step - loss: 0.9714 - acc: 0.6724 - val_loss: 0.8261 - val_acc: 0.7586 Epoch 10/40 112/112 [==============================] - 14s 129ms/step - loss: 0.9230 - acc: 0.6979 - val_loss: 0.7831 - val_acc: 0.7712 Epoch 11/40 112/112 [==============================] - 14s 129ms/step - loss: 0.8847 - acc: 0.6973 - val_loss: 0.7415 - val_acc: 0.7863 Epoch 12/40 112/112 [==============================] - 14s 128ms/step - loss: 0.8003 - acc: 0.7360 - val_loss: 0.7058 - val_acc: 0.8034 Epoch 13/40 112/112 [==============================] - 14s 128ms/step - loss: 0.7641 - acc: 0.7573 - val_loss: 0.6745 - val_acc: 0.8135 Epoch 14/40 112/112 [==============================] - 14s 129ms/step - loss: 0.7114 - acc: 0.7734 - val_loss: 0.6487 - val_acc: 0.8173 Epoch 15/40 112/112 [==============================] - 14s 128ms/step - loss: 0.6850 - acc: 0.7893 - val_loss: 0.6177 - val_acc: 0.8353 Epoch 16/40 112/112 [==============================] - 14s 129ms/step - loss: 0.6268 - acc: 0.8133 - val_loss: 0.5933 - val_acc: 0.8391 Epoch 17/40 112/112 [==============================] - 14s 128ms/step - loss: 0.6290 - acc: 0.8072 - val_loss: 0.5701 - val_acc: 0.8470 Epoch 18/40 112/112 [==============================] - 14s 128ms/step - loss: 0.5948 - acc: 0.8192 - val_loss: 0.5483 - val_acc: 0.8525 Epoch 19/40 112/112 [==============================] - 14s 129ms/step - loss: 0.5857 - acc: 0.8250 - val_loss: 0.5308 - val_acc: 0.8575 Epoch 20/40 112/112 [==============================] - 14s 129ms/step - loss: 0.5327 - acc: 0.8407 - val_loss: 0.5114 - val_acc: 0.8655 Epoch 21/40 112/112 [==============================] - 14s 129ms/step - loss: 0.5060 - acc: 0.8564 - val_loss: 0.4989 - val_acc: 0.8621 Epoch 22/40 112/112 [==============================] - 14s 129ms/step - loss: 0.4801 - acc: 0.8630 - val_loss: 0.4843 - val_acc: 0.8663 Epoch 23/40 112/112 [==============================] - 14s 129ms/step - loss: 0.4595 - acc: 0.8722 - val_loss: 0.4667 - val_acc: 0.8726 Epoch 24/40 112/112 [==============================] - 14s 129ms/step - loss: 0.4436 - acc: 0.8764 - val_loss: 0.4516 - val_acc: 0.8772 Epoch 25/40 112/112 [==============================] - 14s 128ms/step - loss: 0.4235 - acc: 0.8861 - val_loss: 0.4402 - val_acc: 0.8780 Epoch 26/40 112/112 [==============================] - 14s 129ms/step - loss: 0.3980 - acc: 0.8928 - val_loss: 0.4326 - val_acc: 0.8793 Epoch 27/40 112/112 [==============================] - 14s 129ms/step - loss: 0.3811 - acc: 0.9001 - val_loss: 0.4197 - val_acc: 0.8797 Epoch 28/40 112/112 [==============================] - 14s 129ms/step - loss: 0.3624 - acc: 0.9022 - val_loss: 0.4035 - val_acc: 0.8873 Epoch 29/40 112/112 [==============================] - 14s 129ms/step - loss: 0.3640 - acc: 0.9048 - val_loss: 0.3977 - val_acc: 0.8877 Epoch 30/40 112/112 [==============================] - 14s 128ms/step - loss: 0.3423 - acc: 0.9131 - val_loss: 0.3912 - val_acc: 0.8902 Epoch 31/40 112/112 [==============================] - 14s 128ms/step - loss: 0.3318 - acc: 0.9114 - val_loss: 0.3783 - val_acc: 0.8894 Epoch 32/40 112/112 [==============================] - 14s 128ms/step - loss: 0.3037 - acc: 0.9195 - val_loss: 0.3710 - val_acc: 0.8944 Epoch 33/40 112/112 [==============================] - 14s 128ms/step - loss: 0.3014 - acc: 0.9275 - val_loss: 0.3657 - val_acc: 0.8940 Epoch 34/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2982 - acc: 0.9266 - val_loss: 0.3611 - val_acc: 0.8919 Epoch 35/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2834 - acc: 0.9267 - val_loss: 0.3463 - val_acc: 0.8969 Epoch 36/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2796 - acc: 0.9321 - val_loss: 0.3420 - val_acc: 0.8998 Epoch 37/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2561 - acc: 0.9466 - val_loss: 0.3372 - val_acc: 0.8998 Epoch 38/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2392 - acc: 0.9426 - val_loss: 0.3286 - val_acc: 0.8998 Epoch 39/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2484 - acc: 0.9455 - val_loss: 0.3247 - val_acc: 0.9040 Epoch 40/40 112/112 [==============================] - 14s 128ms/step - loss: 0.2399 - acc: 0.9459 - val_loss: 0.3200 - val_acc: 0.9011
Predictions
Angry
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are angry
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Angry/Angry20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Disgust
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Disgust/Disgust20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
Fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Fear/Fear20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
Happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Happy/Happy20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Neutral
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are disgusted
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Neutral/Neutral20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are fear
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are angry
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Sad/Sad20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
Surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised1.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised2.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised3.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised4.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised5.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised6.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised7.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised8.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised9.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised10.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised11.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised12.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised13.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
you are happy
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised14.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised15.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised16.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised17.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are sad
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised18.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised19.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised
image1 = Image.open("/content/drive/MyDrive/images/unclassifiedImages/Surprised/Surprised20.jpg")
plt.imshow(image1)
plt.show()
rgbImage = image1.resize((224,224),Image.ANTIALIAS).convert('RGB')
plt.imshow(rgbImage)
plt.show()
Xt = []
Xt.append(np.array(rgbImage))
# Convert to NP array
Xt = np.array(Xt)
# Reshape 2D
Xt = Xt.reshape(Xt.shape[0], 224, 224, 3).astype('float32')
# Normalize the data
Xt = Xt /255
result = model2.predict_classes(Xt)
#result = np.argmax(modelC.predict(Xt))
plt.imshow(image1)
plt.show()
if result[0] == 1:
print("You are angry")
if result[0] == 2:
print("You are disgusted")
if result[0] == 3:
print("you are fear")
if result[0] == 4:
print("you are happy")
if result[0] == 5:
print("You are netural")
if result[0] == 6:
print("You are sad")
if result[0] == 7:
print("You are surprised")
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/sequential.py:450: UserWarning: `model.predict_classes()` is deprecated and will be removed after 2021-01-01. Please use instead:* `np.argmax(model.predict(x), axis=-1)`, if your model does multi-class classification (e.g. if it uses a `softmax` last-layer activation).* `(model.predict(x) > 0.5).astype("int32")`, if your model does binary classification (e.g. if it uses a `sigmoid` last-layer activation).
warnings.warn('`model.predict_classes()` is deprecated and '
You are surprised